 import {LOGIN,LOGOUT} from '../actionTypes'
 const initValue={
    token:''
}
export default function login(state=initValue,action){
    if(action.type===LOGIN){
        return {
            ...state,
            token:action.payload}
        }else if(action.type===LOGOUT) {
            return {...state,token:''}
        }
        return state
    }
